﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Masters/AdminSchedule.master" AutoEventWireup="true"
	CodeFile="BusView.aspx.cs" Inherits="Pages_BusView" %>

<asp:Content ID="Content1" ContentPlaceHolderID="cphHead" runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="cphContent" runat="Server">
	<div style="text-align: center;">
		<asp:Label runat="server" Text="Часть названия автобуса" />
		<asp:TextBox ID="tbBusName" runat="server" Width="50%" OnTextChanged="tbBusNames_TextChanged"/>
		<asp:Button ID="btnSearch" runat="server" Text="Найти" /><br /><br />
		
		<div>
			<a href="BusEdit.aspx">добавить автобус</a>
		</div>

		<br />
		<asp:Label ID="lblResult" runat="server" ForeColor="Red"/><br />

		<asp:GridView runat="server" ID="gvBuses" AutoGenerateColumns="false" Width="70%" HeaderStyle-HorizontalAlign="Center" GridLines="None" HorizontalAlign="Center">
			<Columns>
				<asp:BoundField DataField="Name" HeaderText="Название" />
				<asp:BoundField DataField="PlaceCount" HeaderText="Кол-во мест" />
				<asp:TemplateField ItemStyle-Font-Size="10px">
					<ItemTemplate>
						<a href="BusEdit.aspx?id=<%# Eval("Id") %>">редактировать</a>
					</ItemTemplate>
				</asp:TemplateField>
				<asp:TemplateField ItemStyle-Font-Size="10px">
					<ItemTemplate>
						<asp:LinkButton runat="server" OnClientClick="return confirm('Удалить?');" CommandArgument='<%# Eval("Id") %>' OnCommand="btnDelete_Command" Text="удалить" />
					</ItemTemplate>
				</asp:TemplateField>
			</Columns>
		</asp:GridView>
	</div>
</asp:Content>
